<?php
require_once("libs/dbmodel.php");

class Nombre_categoria extends DbModel {
	
	/**
	 * Get a category using both (categoria, nombre_categoria) tables
	 * @param string $text
	 * @param string $lang
	 * @return boolean
	 */
	public function getCategoryList($text, $lang) {
		if ($text != "*") {
			$this->addCondition("nombre", "$text%", DB_ILIKE);
		}
		$this->addCondition("idioma", $lang);
		if ($this->doSelectAllWithForeign("categoria", "id_categoria")) {
			return true;
		} else {
			return false;
		}
	}
}

?>
